<div class="content">

    <!-- Dialog Box -->


    <div class="leftDiv">

        <div class="menu">
            <span class="mobile_radar" type="4" showtype='Zobrazí mobilné radary na mape'
                  showingtype='Zobrazujú sa mobilné radary na mape'><img style="vertical-align: middle;"
                                                                         src="<?=base_url()?>css/images/mobile_radar.png"
                                                                         height="29" width="25"></span>
            <span class="radar" type="1" showtype='Zobrazí radary na mape'
                  showingtype='Zobrazujú sa radary na mape'><img style="vertical-align: middle;"
                                                                 src="<?=base_url()?>css/images/speed.png" height="29"
                                                                 width="25"></span>
            <span class="police" type="2" showtype='Zobrazí hliadky na mape' showingtype='Zobrazujú sa hliadky na mape'><img
                    style="vertical-align: middle;" src="<?=base_url()?>css/images/police.png" height="29"
                    width="25"></span>
            <span class="accident" type="3" showtype='Zobrazí nehody na mape' showingtype='Zobrazujú sa nehody na mape'><img
                    style="vertical-align: middle;" src="<?=base_url()?>css/images/accident.png" height="29" width="25"></span>
            <span class="all" type="0" showtype='Zobrazí všetky typy udalosti na mape'
                  showingtype='Zobrazuje sa všetko na mape'><img style="vertical-align: middle;"
                                                                 src="<?=base_url()?>css/images/all.png" height="29"
                                                                 width="25"> </span>
        </div>
        <div class="vypis">

        </div>
        <!-- Radary | Hliadky | Nehody | Zle cesty | Vsetko</div> -->
        <div class="map">
            <!-- <img src="css/images/mapa.jpg" alt="mapa" width="624" height="350"/> -->
            <?php echo $map['html']; ?>
        </div>

        <div class="last_routes">
            <div class="routesNadpis"><h3>Posledné hľadané trasy užívateľmi</h3></div>

            <?php
            br(2);
            if (isset($pos_from)) {
                echo "<table border='0' id='last_routes_table'>";
                echo "<tr><th colspan='2' style='width:280px;'>Odkiaľ: (štát / cesta/ulica / mesto)</th>
				<th colspan='2' style='width:280px;'>Kam: (štát / cesta/ulica / mesto)</th>
					<th style='width:46px;'>km</th>
					<th><img style='border:none; vertical-align: middle;' src='" . base_url() . "css/images/speed.png' height='24' alt='Radar' title='Radar'></th>
					<th><img style='border:none; vertical-align: middle;' src='" . base_url() . "css/images/police.png' height='24' alt='Hliadka' title='Hliadka'></th>
					<th><img style='border:none; vertical-align: middle;' src='" . base_url() . "css/images/accident.png' height='24' alt='Nehoda' title='Nehoda'></th>
					<th><img style='border:none; vertical-align: middle;' src='" . base_url() . "css/images/mobile_radar.png' height='24' alt='Mobilný radar' title='Mobilný radar'></th>
				</tr>";
                for ($i = 0; $i < count($pos_from); $i++) {
                    echo "<tr>";
                    echo "<td>";
                    $src_from = base_url() . "css/images/flags/" . $s_image[$i];
                    echo img(array('src' => $src_from,
                        'style' => 'height:10px;vertical-align:middle;margin-left:5px;',
                        'alt' => $s_state[$i],
                        'title' => $s_state[$i])) . "</td><td>" . $pos_from[$i] . "</td>";

                    echo "<td>";
                    $src_to = base_url() . "css/images/flags/" . $e_image[$i];
                    echo img(array('src' => $src_to,
                        'style' => 'height:10px;vertical-align:middle;margin-left:5px;',
                        'alt' => $e_state[$i],
                        'title' => $e_state[$i])) . "</td><td>" . $pos_to[$i] . "</td>";

                    echo "<td class='nums'>" . $route_km[$i] . "</td>
					<td class='nums'>" . $radars[$i] . "</td>
					<td class='nums'>" . $patrols[$i] . "</td>
					<td class='nums'>" . $accidents[$i] . "</td>
					<td class='nums'>" . $mobileradars[$i] . "</td>";
                    echo "</tr>";
                }
                echo "</table>" . br(1);
            }
            ?>
            <div style="text-align: center; font-size: 11px;">
                Užívatelia vytvorili cesty o dĺžke <b><?= $all_kilometres ?></b>
                kilometrov, na ktorých sa vyskytlo <b><?= $all_reports ?></b> udalosti. Ich prejdením by na cestách
                strávili viac ako <b>
                <?php echo ($all_time_driven['years'] != 0) ? $all_time_driven['years'] . " rok" : ""; ?>
                <?= $all_time_driven['days'] ?> dní a
                <?= $all_time_driven['hours'] ?> hodín.
            </b></div>


        </div>
        <div class="infoPanel">
            <div class="users">
                <?php
                $this->load->view('users/getUsers');
                ?>
            </div>
            <div class="reports">
                <div class="reportsNadpis">
                    <img style="vertical-align: middle; height: 20px; width: 22px;"
                         src="<?=base_url()?>css/images/reports.png" alt="Udalosti"/>

                    <h3>Počet udalosti</h3>
                </div>
                <ul>
                    <?php $this->load->view('reports/numberOfReports'); ?>
                </ul>

            </div>
        </div>


    </div>
    <div class="rightDiv">


        <div class="first"></div>

        <div class="lastReports">
            <?php
            $this->load->view('reports/last');
            ?>
        </div>


        <div class="graf">
            <!-- <div style="border-bottom: solid 1px gray; margin-bottom: 5px;">Úspešnosť zaznamenania radarov a hliadok</div> -->
            <div class="grafNadpis"><h3>Štatistika za posledné dni
                <!-- <img style="vertical-align: middle;" src="<?=base_url()?>css/images/help.png"> -->
            </h3></div>
            <div>

                <?php
                $this->load->view('templates/nacitanie_grafu');
                // include 'zobrazenie_grafu.php'; ?>
            </div>

        </div>


    </div>
</div>